package com.sunwayhorizo.health.business.integration.securityI;

import java.util.List;

import javax.ejb.Stateless;

import org.jboss.seam.Component;
import org.jboss.seam.annotations.Name;

import com.sunwayhorizo.health.business.dto.clinic.consultation.InviteInfoDTO;
import com.sunwayhorizo.health.business.dto.patad.empi.PatientBaseInfoDTO;
import com.sunwayhorizo.health.business.dto.registries.DepartmentDTO;
import com.sunwayhorizo.health.business.dto.registries.OrganizationDTO;
import com.sunwayhorizo.health.hl7.common.Hl7Exception;

@Name("SecurityInterfaceWrapManager")
@Stateless
public class SecurityInterfaceWrapManager implements SecurityInterfaceWrapManagerLocal
{
    public OrganizationDTO findOrganizationByCode(String orgCode) throws Hl7Exception
    {
        SecurityInterfaceManagerLocal manager = (SecurityInterfaceManagerLocal) Component.getInstance("SecurityInterfaceManager");
        return manager.findOrganizationByCode(orgCode);
    }


    public DepartmentDTO findDepartmentByCode(String departmentCode) throws Hl7Exception
    {
        SecurityInterfaceManagerLocal manager = (SecurityInterfaceManagerLocal) Component.getInstance("SecurityInterfaceManager");
        return manager.findDepartmentByCode(departmentCode);
    }


    public PatientBaseInfoDTO findEmployeeByCode(String empCode) throws Hl7Exception
    {
        SecurityInterfaceManagerLocal manager = (SecurityInterfaceManagerLocal) Component.getInstance("SecurityInterfaceManager");
        return manager.findEmployeeByCode(empCode);
    }


    public List<DepartmentDTO> findWorkGroupListByEmployeeCode(String empCode) throws Hl7Exception
    {
        SecurityInterfaceManagerLocal manager = (SecurityInterfaceManagerLocal) Component.getInstance("SecurityInterfaceManager");
        return manager.findWorkGroupListByEmpCode(empCode);
    }

    @Override
    public String findEmpCodeByAccount(String accountName, String password)
    {
        SecurityInterfaceManagerLocal manager = (SecurityInterfaceManagerLocal) Component.getInstance("SecurityInterfaceManager");
        String empCode = manager.findEmpCodeByAccount(accountName, password);
        return empCode;
    }
}
